*===============================================================================
*
*					WORKER BELIEFS ABOUT OUTSIDE OPTIONS
*		(c)	Simon Jaeger, Christopher Roth, Nina Roussille, Benjamin Schoefer
*							  2023 December 5
*						   	   SOEP-IAB Data 
*
*===============================================================================


********************************************************************************
*								Figure B01	 								   *
********************************************************************************

cap log close                             
log using ${log}/FigureB01.log, replace

use "$data/unionsample_finaldata.dta", clear		
cap noisily keep if feff_2010_2017!=. & salary!=. 
	
cap drop belief_oo_eur
winsor newpay_quit_mid, p(0.02) gen(belief_oo_eur)
	
local xtitle "Belief About Wage Change if Moving to Outside Option"

su belief_oo_eur, d
	local mean: di %5.0f `r(mean)'
	local p50: di %5.0f `r(p50)'
	local N = r(N)			
twoway (function y=`p50', range(0 0.6) lcolor(gs3) horizontal) (function y=`mean', range(0 0.6) lcolor(maroon) lpattern(dash) horizontal) (hist belief_oo_eur, frac bcolor(navy%60) fcolor(navy)), ///
legend(order(1 "Median:	`p50'" 2 "Mean:	`mean'") cols(1) ring(0) size(medsmall) position(11) region(lwidth(none)))	///
xtitle(`xtitle',  size(${fontsize})) ///
ytitle("Fraction", size(${fontsize})) ysc(r(0 `ymax')) ///
ylabel(#5,grid) xlabel(#10,grid)
graph export ${log}/FigureB01.pdf, replace

log close
clear
